package com.example.wechat.login.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("wechat_user")
public class WechatUser {
    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField(value = "openid", insertStrategy = FieldStrategy.NOT_NULL)
    private String openid;

    private String unionid;
    private String sessionKey;
    private String nickname;
    
    @TableField("avatar_url")
    private String avatarUrl;

    private Integer gender;
    private String country;
    private String province;
    private String city;
    private String language;
    private String phoneNumber;
    private LocalDateTime lastLoginTime;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    public WechatUser() {
    }

    public Long getId() {
        return this.id;
    }

    public String getOpenid() {
        return this.openid;
    }

    public String getUnionid() {
        return this.unionid;
    }

    public String getSessionKey() {
        return this.sessionKey;
    }

    public String getNickname() {
        return this.nickname;
    }

    public String getAvatarUrl() {
        return this.avatarUrl;
    }

    public Integer getGender() {
        return this.gender;
    }

    public String getCountry() {
        return this.country;
    }

    public String getProvince() {
        return this.province;
    }

    public String getCity() {
        return this.city;
    }

    public String getLanguage() {
        return this.language;
    }

    public String getPhoneNumber() {
        return this.phoneNumber;
    }

    public LocalDateTime getLastLoginTime() {
        return this.lastLoginTime;
    }

    public LocalDateTime getCreateTime() {
        return this.createTime;
    }

    public LocalDateTime getUpdateTime() {
        return this.updateTime;
    }

    public void setId(final Long id) {
        this.id = id;
    }

    public void setOpenid(final String openid) {
        this.openid = openid;
    }

    public void setUnionid(final String unionid) {
        this.unionid = unionid;
    }

    public void setSessionKey(final String sessionKey) {
        this.sessionKey = sessionKey;
    }

    public void setNickname(final String nickname) {
        this.nickname = nickname;
    }

    public void setAvatarUrl(final String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public void setGender(final Integer gender) {
        this.gender = gender;
    }

    public void setCountry(final String country) {
        this.country = country;
    }

    public void setProvince(final String province) {
        this.province = province;
    }

    public void setCity(final String city) {
        this.city = city;
    }

    public void setLanguage(final String language) {
        this.language = language;
    }

    public void setPhoneNumber(final String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public void setLastLoginTime(final LocalDateTime lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public void setCreateTime(final LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public void setUpdateTime(final LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof WechatUser)) {
            return false;
        } else {
            WechatUser other = (WechatUser)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$id = this.getId();
                Object other$id = other.getId();
                if (this$id == null) {
                    if (other$id != null) {
                        return false;
                    }
                } else if (!this$id.equals(other$id)) {
                    return false;
                }

                Object this$gender = this.getGender();
                Object other$gender = other.getGender();
                if (this$gender == null) {
                    if (other$gender != null) {
                        return false;
                    }
                } else if (!this$gender.equals(other$gender)) {
                    return false;
                }

                Object this$openid = this.getOpenid();
                Object other$openid = other.getOpenid();
                if (this$openid == null) {
                    if (other$openid != null) {
                        return false;
                    }
                } else if (!this$openid.equals(other$openid)) {
                    return false;
                }

                Object this$unionid = this.getUnionid();
                Object other$unionid = other.getUnionid();
                if (this$unionid == null) {
                    if (other$unionid != null) {
                        return false;
                    }
                } else if (!this$unionid.equals(other$unionid)) {
                    return false;
                }

                Object this$sessionKey = this.getSessionKey();
                Object other$sessionKey = other.getSessionKey();
                if (this$sessionKey == null) {
                    if (other$sessionKey != null) {
                        return false;
                    }
                } else if (!this$sessionKey.equals(other$sessionKey)) {
                    return false;
                }

                Object this$nickname = this.getNickname();
                Object other$nickname = other.getNickname();
                if (this$nickname == null) {
                    if (other$nickname != null) {
                        return false;
                    }
                } else if (!this$nickname.equals(other$nickname)) {
                    return false;
                }

                Object this$avatarUrl = this.getAvatarUrl();
                Object other$avatarUrl = other.getAvatarUrl();
                if (this$avatarUrl == null) {
                    if (other$avatarUrl != null) {
                        return false;
                    }
                } else if (!this$avatarUrl.equals(other$avatarUrl)) {
                    return false;
                }

                Object this$country = this.getCountry();
                Object other$country = other.getCountry();
                if (this$country == null) {
                    if (other$country != null) {
                        return false;
                    }
                } else if (!this$country.equals(other$country)) {
                    return false;
                }

                Object this$province = this.getProvince();
                Object other$province = other.getProvince();
                if (this$province == null) {
                    if (other$province != null) {
                        return false;
                    }
                } else if (!this$province.equals(other$province)) {
                    return false;
                }

                Object this$city = this.getCity();
                Object other$city = other.getCity();
                if (this$city == null) {
                    if (other$city != null) {
                        return false;
                    }
                } else if (!this$city.equals(other$city)) {
                    return false;
                }

                Object this$language = this.getLanguage();
                Object other$language = other.getLanguage();
                if (this$language == null) {
                    if (other$language != null) {
                        return false;
                    }
                } else if (!this$language.equals(other$language)) {
                    return false;
                }

                Object this$phoneNumber = this.getPhoneNumber();
                Object other$phoneNumber = other.getPhoneNumber();
                if (this$phoneNumber == null) {
                    if (other$phoneNumber != null) {
                        return false;
                    }
                } else if (!this$phoneNumber.equals(other$phoneNumber)) {
                    return false;
                }

                Object this$lastLoginTime = this.getLastLoginTime();
                Object other$lastLoginTime = other.getLastLoginTime();
                if (this$lastLoginTime == null) {
                    if (other$lastLoginTime != null) {
                        return false;
                    }
                } else if (!this$lastLoginTime.equals(other$lastLoginTime)) {
                    return false;
                }

                Object this$createTime = this.getCreateTime();
                Object other$createTime = other.getCreateTime();
                if (this$createTime == null) {
                    if (other$createTime != null) {
                        return false;
                    }
                } else if (!this$createTime.equals(other$createTime)) {
                    return false;
                }

                Object this$updateTime = this.getUpdateTime();
                Object other$updateTime = other.getUpdateTime();
                if (this$updateTime == null) {
                    if (other$updateTime != null) {
                        return false;
                    }
                } else if (!this$updateTime.equals(other$updateTime)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof WechatUser;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $gender = this.getGender();
        result = result * 59 + ($gender == null ? 43 : $gender.hashCode());
        Object $openid = this.getOpenid();
        result = result * 59 + ($openid == null ? 43 : $openid.hashCode());
        Object $unionid = this.getUnionid();
        result = result * 59 + ($unionid == null ? 43 : $unionid.hashCode());
        Object $sessionKey = this.getSessionKey();
        result = result * 59 + ($sessionKey == null ? 43 : $sessionKey.hashCode());
        Object $nickname = this.getNickname();
        result = result * 59 + ($nickname == null ? 43 : $nickname.hashCode());
        Object $avatarUrl = this.getAvatarUrl();
        result = result * 59 + ($avatarUrl == null ? 43 : $avatarUrl.hashCode());
        Object $country = this.getCountry();
        result = result * 59 + ($country == null ? 43 : $country.hashCode());
        Object $province = this.getProvince();
        result = result * 59 + ($province == null ? 43 : $province.hashCode());
        Object $city = this.getCity();
        result = result * 59 + ($city == null ? 43 : $city.hashCode());
        Object $language = this.getLanguage();
        result = result * 59 + ($language == null ? 43 : $language.hashCode());
        Object $phoneNumber = this.getPhoneNumber();
        result = result * 59 + ($phoneNumber == null ? 43 : $phoneNumber.hashCode());
        Object $lastLoginTime = this.getLastLoginTime();
        result = result * 59 + ($lastLoginTime == null ? 43 : $lastLoginTime.hashCode());
        Object $createTime = this.getCreateTime();
        result = result * 59 + ($createTime == null ? 43 : $createTime.hashCode());
        Object $updateTime = this.getUpdateTime();
        result = result * 59 + ($updateTime == null ? 43 : $updateTime.hashCode());
        return result;
    }

    public String toString() {
        return "WechatUser(id=" + this.getId() + ", openid=" + this.getOpenid() + ", unionid=" + this.getUnionid() + ", sessionKey=" + this.getSessionKey() + ", nickname=" + this.getNickname() + ", avatarUrl=" + this.getAvatarUrl() + ", gender=" + this.getGender() + ", country=" + this.getCountry() + ", province=" + this.getProvince() + ", city=" + this.getCity() + ", language=" + this.getLanguage() + ", phoneNumber=" + this.getPhoneNumber() + ", lastLoginTime=" + this.getLastLoginTime() + ", createTime=" + this.getCreateTime() + ", updateTime=" + this.getUpdateTime() + ")";
    }
}
